<!DOCTYPE html>
<html lang="cn" xmlns:th="http://www.thymeleaf.org">
<head th:replace="~{baseui/head :: head}">
    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
    <meta name="description" content="动检通智慧云平台"/>
    <meta name="author" content="牧中(上海)物联网科技有限公司"/>
    <link rel="shortcut icon" href="/webjars/images/favicon.png"/>

    <title>牧中畜牧业大数据智慧云平台V1.0</title>


</head>
<body>
<!--顶部一级导航-->
<th:block th:replace="baseui/topheader :: topheader(1)"/>

<!--动检通菜单-->
<div id="topnav" th:replace="djt/partial/topnav :: topnav(2)"></div>


<div id="cl-wrapper">
    <!--左边导航-->
    <th:block th:replace="djt/partial/prod_left :: nav(11)" />

    <div class="container-fluid" id="pcont">

        <div class="cl-mcont">
            <!--排行榜-->
            <div class="row">
                <div class="col-md-12">
                    <div class="block-flat">
                        <div class="header">
                            <h4>免疫排行榜</h4>

                        </div>
                        <div class="content">

                            <div class="row">

                                <div class="col-md-6 col-sm-6">
                                    <!--免疫地区排行-->
                                    <div class="block-flat">
                                        <div class="header">


                                            <h4>免疫地区排行 Top10</h4>

                                        </div>



                                        <div class="content" style="height: 400px">
                                            <table class="no-border blue">
                                                <thead class="no-border">
                                                <tr>
                                                    <th>排行</th>
                                                    <th>区域</th>
                                                    <th>次数</th>

                                                </tr>
                                                </thead>
                                                <tbody class="no-border-x" th:each="map:${maplist}">
                                                <tr>
                                                    <td th:text="${mapStat.index+1}">1</td>
                                                    <td th:text="${map['regin']}" >金山</td>
                                                    <td th:text="${map['times']}">3000</td>

                                                </tr>
                                               <!-- <tr>
                                                    <td>2</td>
                                                    <td>杨浦</td>
                                                    <td>2900</td>

                                                </tr>
                                                <tr>
                                                    <td>3</td>
                                                    <td>浦东</td>
                                                    <td>2600</td>

                                                </tr>
                                                <tr>
                                                    <td>4</td>
                                                    <td>崇明</td>
                                                    <td>2000</td>

                                                </tr>
                                                <tr>
                                                    <td>5</td>
                                                    <td>宝山</td>
                                                    <td>1000</td>

                                                </tr>-->
                                                </tbody>
                                            </table>

                                        </div>

                                    </div>


                                </div>

                                <div class="col-md-6 col-sm-6">
                                    <!--免疫病种排行-->
                                    <div class="block-flat">
                                        <div class="header">

                                            <h4>免疫病种排行 Top10</h4>

                                        </div>
                                        <div class="content" style="height: 400px">

                                            <table class="no-border blue">
                                                <thead class="no-border">
                                                <tr>
                                                    <th>排行</th>
                                                    <th>病种</th>
                                                    <th>次数</th>

                                                </tr>
                                                </thead>
                                                <tbody class="no-border-x" th:each="map1:${maplist1}">
                                                <tr>
                                                    <td th:text="${map1Stat.index+1}">1</td>
                                                    <td th:text="${map1['type']}" class="imtype">感冒</td>
                                                    <td th:text="${map1['alltimes']}">3000</td>

                                                </tr>

                                                </tbody>
                                            </table>

                                        </div>

                                    </div>
                                </div>

                            </div>

                        </div>

                    </div>


                </div>
            </div>

            <!--免疫走势图-->
            <div class="row">
                <div class="col-md-12">
                    <div class="block-flat">
                        <div class="header">
                            <h4>免疫走势图</h4>

                        </div>
                        <div class="content">
                            <div id="weekChart" style="width: 1000px;height:300px;"></div>

                        </div>

                    </div>


                </div>
            </div>

            <!--免疫走势图end-->
            <!--区域免疫对比图-->
            <div class="row">
                <div class="col-md-12">
                    <div class="block-flat">
                        <div class="header">
                            <div class="pull-right" style="width:85%">

                                <div class="row show-grid">
                                   <!-- <div class="col-md-2">
                                        <div class="btn-group">
                                            <button type="button" class="btn btn-default">本周</button>
                                            <button type="button" class="btn btn-default">本月</button>
                                        </div>

                                    </div>-->
                                    <div class="col-md-3">
                                        <div class="input-daterange input-group">
                                            <input type="text" class="input-sm form-control date datetime" data-min-view="2" name="start"  data-date-format="yyyy-mm-dd" id="start">
                                            <span class="input-group-addon">到</span>
                                            <input type="text" class="input-sm form-control date datetime" data-min-view="2" name="end"  data-date-format="yyyy-mm-dd" id="end">
                                        </div>
                                    </div>
                                    <div class="col-md-2">
                                        <select class="select2" style="max-width: 100px;"  id="city">
                                            <option value="全部" >所有区域</option>
                                            <span th:each="cityAreaDto :${cityAreaDtoList}">
                                                            <optgroup  th:label="${cityAreaDto.city}" >
                                                                <span th:each="region :${cityAreaDto.regions}">
                                                            <option th:value="${region}" th:text="${region}">南漳县</option>
                                                                    </span>
                                                          </optgroup>
                                                                   </span>
                                        </select>
                                    </div>


                                    <div class="col-md-1"><button type="button" class="btn btn-primary" onclick="t9()">搜索</button></div>

                                </div>


                            </div>
                            <br/>
                            <h4>区域免疫对比图</h4>

                        </div>
                        <div class="content">
                            <div class="row">

                                <div class="col-md-6 col-sm-6">
                                    <table class="no-border blue">
                                        <thead class="no-border">
                                        <tr>
                                            <th>地区</th>

                                            <th>次数</th>
                                            <th>同比</th>

                                            <th class="text-right">环比</th>
                                        </tr>
                                        </thead>
                                        <tbody class="no-border-x" th:each="map:${maplist}">
                                        <tr>
                                            <td th:text="${map['regin']}">金山</td>
                                            <td th:text="${map['times']}">2000</td>
                                            <td><i class="fa fa-angle-up"></i>30%</td>

                                            <td class="text-right color-danger"><i class="fa fa-angle-up"></i>28%</td>
                                        </tr>

                                        </tbody>
                                    </table>
                                </div>
                                <div class="col-md-6 col-sm-6">
                                    <div id="areaChart" style="width: 500px;height:200px;"></div>
                                </div>


                            </div>

                        </div>


                    </div>
                </div>

            </div>
            <!--区域免疫对比图end-->
            <!--免疫病种对比图-->
            <div class="row">
                <div class="col-md-12">
                    <div class="block-flat">
                        <div class="header">
                            <div class="pull-right" style="width:85%">

                                <div class="row show-grid">
                                    <div class="col-md-2">
                                        <div class="btn-group">
                                            <button type="button" class="btn btn-default">本周</button>
                                            <button type="button" class="btn btn-default">本月</button>
                                        </div>

                                    </div>
                                    <div class="col-md-3">
                                        <div class="input-daterange input-group" id="datepicker">
                                            <input type="text" class="input-sm form-control date datetime" data-min-view="2" name="start"  data-date-format="yyyy-mm-dd" id="start1">
                                            <span class="input-group-addon">到</span>
                                            <input type="text" class="input-sm form-control date datetime" data-min-view="2" name="end"  data-date-format="yyyy-mm-dd" id="end1">
                                        </div>
                                    </div>
                                    <div class="col-md-2">
                                        <select class="select2" style="max-width: 100px;"  id="city1">
                                            <option value="全部" >所有区域</option>
                                            <span th:each="cityAreaDto :${cityAreaDtoList}">
                                                            <optgroup  th:label="${cityAreaDto.city}" >
                                                                <span th:each="region :${cityAreaDto.regions}">
                                                            <option th:value="${region}" th:text="${region}">南漳县</option>
                                                                    </span>
                                                          </optgroup>
                                                                   </span>
                                        </select>
                                    </div>


                                    <div class="col-md-1"><button type="button" class="btn btn-primary" onclick="t16()">搜索</button></div>

                                </div>


                            </div>
<br/>
                            <h4>免疫病种对比图</h4>

                        </div>
                        <div class="content">
                            <div class="row">

                                <div class="col-md-6 col-sm-6">
                                    <table class="no-border blue">
                                        <thead class="no-border">
                                        <tr>
                                            <th>病种</th>

                                            <th>次数</th>
                                            <th>同比</th>

                                            <th class="text-right">环比</th>
                                        </tr>
                                        </thead>
                                        <tbody class="no-border-x" th:each="map1:${maplist1}">
                                        <tr>
                                            <td th:text="${map1['type']}" class="imtype">蓝耳病</td>
                                            <td th:text="${map1['alltimes']}">2000</td>
                                            <td><i class="fa fa-angle-up"></i>30%</td>

                                            <td class="text-right color-danger"><i class="fa fa-angle-up"></i>28%</td>
                                        </tr>


                                        </tbody>
                                    </table>
                                </div>
                                <div class="col-md-6 col-sm-6">
                                    <div id="illChart" style="width: 500px;height:200px;"></div>
                                </div>


                            </div>

                        </div>


                    </div>
                </div>

                <!--免疫病种对比图end-->
            </div>
        </div>

    </div>
</div>
        <script type="text/javascript" src="/webjars/js/jquery.js"></script>


        <script type="text/javascript" src="/webjars/js/jquery.nanoscroller/jquery.nanoscroller.js"></script>
        <script type="text/javascript" src="/webjars/js/behaviour/general.js"></script>
        <script src="/webjars/js/jquery.ui/jquery-ui.js" type="text/javascript"></script>

        <script type="text/javascript" src="/webjars/js/jquery.nestable/jquery.nestable.js"></script>
        <script type="text/javascript" src="/webjars/js/bootstrap.switch/bootstrap-switch.min.js"></script>
        <script type="text/javascript" src="/webjars/js/bootstrap.datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
        <script src="//cdn.bootcss.com/select2/3.4.5/select2.min.js" type="text/javascript"></script>

        <script src="/webjars/js/bootstrap.slider/js/bootstrap-slider.js" type="text/javascript"></script>
        <script type="text/javascript" src="/webjars/js/jquery.niftymodals/js/jquery.modalEffects.js"></script>
        <script type="text/javascript" src="/webjars/js/bootstrap.summernote/dist/summernote.min.js"></script>

        <script type="text/javascript" src="/webjars/js/jquery.magnific-popup/dist/jquery.magnific-popup.min.js"></script>



        <script src="/webjars/js/behaviour/voice-commands.js"></script>
        <script src="/webjars/js/bootstrap/dist/js/bootstrap.min.js"></script>

        <script src="//cdn.bootcss.com/echarts/3.6.2/echarts.min.js"></script>

        <script type="text/javascript">
            $(document).ready(function(){

                App.init();
            });
        </script>
        <script type="text/javascript">
            // ------近一年趋势变化图-----

            function t4(a) {

                var array= new Array();
                $.ajax({

                    url: '/djt/breedarch/nowtyearim',
                    data: {productType : a} ,
                    dataType :'json',
                    async: false,
                    success: function (data) {
                        for (var i =0;i<data.length;i++){

                            if (data[i]!=null) {
                                array.push(data[i].times);
                            }else {
                                array.push(0);
                            }
                        }


                    }
                });
                return array;


            }

            var weekChart = echarts.init(document.getElementById('weekChart'));
            option = {
                tooltip : {
                    trigger: 'axis',
                    axisPointer: {
                        type: 'cross',
                        label: {
                            backgroundColor: '#6a7985'
                        }
                    }
                },
                legend: {
                    data:['猪','牛','羊','家禽'],
                    selected: {
                        '家禽': false
                    }
                },
                toolbox: {
                    feature: {
                        saveAsImage: {}
                    }
                },
                grid: {
                    left: '3%',
                    right: '4%',
                    bottom: '3%',
                    containLabel: true
                },
                xAxis : [
                    {
                        type : 'category',
                        boundaryGap : false,
                        data : ['1月','2月','3月','4月','5月','6月','7月','8月','9月','10月','11月','12月']
                    }
                ],
                yAxis : [
                    {
                        type : 'value'
                    }
                ],
                series : [
                    {
                        name:'猪',
                        type:'line',

                        areaStyle: {normal: {}},
                        data:t4(1)
                    },
                    {
                        name:'牛',
                        type:'line',

                        areaStyle: {normal: {}},
                        data:t4(2)
                    },
                    {
                        name:'羊',
                        type:'line',

                        areaStyle: {normal: {}},
                        data:t4(3)
                    },
                    {
                        name:'家禽',
                        type:'line',

                        areaStyle: {normal: {}},
                        data:t4(4)
                    }
                ]
            };
            weekChart.setOption(option);


            //--------------按区域变化---------------------------

            //获取option集合
            function factoryoption() {




                    var array1 = new Array();
                    $("#city option").each(function () {  //遍历所有option
                        var txt = $(this).val();   //获取option值
                        if (txt !="全部") {
                            array1.push(txt);  //添加到数组中
                        }
                    });

                    return array1;


            }
            function t10() {

                var citys= factoryoption();

                var list =new Array();
                for(var i=0;i<citys.length;i++){

                    var time1 = $("#start").val();
                    var time2 = $("#end").val();
                    if (time1 == "") {
                        time1 = new Date("2000-01-01 :00:00:00");
                    } else {
                        time1 = new Date(time1);
                    }

                    if (time2 == "") {
                        time2 = new Date();
                    } else {
                        time2 = new Date(time2);
                    }
                    var sdata = {   // 构建查询需要的参数
                        city: citys[i],
                        time1: time1,
                        time2: time2
                    };
                    $.ajax({

                        url: '/djt/breedarch/nowtyearim1',
                        data: sdata,
                        dataType :'json',

                        async: false,
                        success: function (data) {
                            list.push(data);
                        }
                    });
                }




                return list;

            }

            function t9() {
                var city =$("#city").val();
                if (city!="全部") {

                    var time1 = $("#start").val();
                    var time2 = $("#end").val();
                    if (time1 == "") {
                        time1 = new Date("2000-01-01 :00:00:00");
                    } else {
                        time1 = new Date(time1);
                    }

                    if (time2 == "") {
                        time2 = new Date();
                    } else {
                        time2 = new Date(time2);
                    }
                    var sdata = {   // 构建查询需要的参数
                        city: city,
                        time1: time1,
                        time2: time2
                    };
                    $.ajax({

                        url: '/djt/breedarch/nowtyearim1',
                        data: sdata,
                        dataType: 'json',
                        async: false,
                        success: function (data) {

                            var areaChart = echarts.init(document.getElementById('areaChart'));
                            option = {

                                tooltip: {
                                    trigger: 'axis',
                                    axisPointer: {
                                        type: 'shadow'
                                    }
                                },
                                legend: {
                                    data: ['猪', '牛', '羊', '家禽'],
                                    selected: {
                                        '家禽': false
                                    }
                                },
                                toolbox: {
                                    feature: {
                                        saveAsImage: {}
                                    }
                                },
                                grid: {
                                    left: '3%',
                                    right: '4%',
                                    bottom: '3%',
                                    containLabel: true
                                },
                                xAxis: {
                                    type: 'value',
                                    boundaryGap: [0, 0.01]
                                },
                                yAxis: {
                                    type: 'category',
                                    data: [data[0].city]
                                },
                                series: [
                                    {
                                        name: '猪',
                                        type: 'bar',
                                        data: [data[0].type]
                                    },
                                    {
                                        name: '牛',
                                        type: 'bar',
                                        data: [data[1].type]
                                    }
                                    ,
                                    {
                                        name: '羊',
                                        type: 'bar',
                                        data: [data[2].type]
                                    }
                                    ,
                                    {
                                        name: '家禽',
                                        type: 'bar',
                                        data: [data[3].type]
                                    }
                                ]
                            };
                            areaChart.setOption(option);


                        }
                    });

                }else{
                    var datas=t10();
                    var array= new Array();
                    var array1= new Array();
                    var array2= new Array();
                    var array3= new Array();
                    var array4= new Array();
                    for (var i=0;i<datas.length;i++){
                        array.push(datas[i][0].city);
                        array1.push(datas[i][0].type);
                        array2.push(datas[i][1].type);
                        array3.push(datas[i][2].type);
                        array4.push(datas[i][3].type);

                    }


                    var areaChart = echarts.init(document.getElementById('areaChart'));
                    option = {

                        tooltip: {
                            trigger: 'axis',
                            axisPointer: {
                                type: 'shadow'
                            }
                        },
                        legend: {
                            data: ['猪', '牛','羊','家禽'],
                            selected: {
                                '家禽': false
                            }
                        },
                        toolbox: {
                            feature: {
                                saveAsImage: {}
                            }
                        },
                        grid: {
                            left: '3%',
                            right: '4%',
                            bottom: '3%',
                            containLabel: true
                        },
                        xAxis: {
                            type: 'value',
                            boundaryGap: [0, 0.01]
                        },
                        yAxis: {
                            type: 'category',
                            data: array
                        },
                        series: [
                            {
                                name: '猪',
                                type: 'bar',
                                data: array1
                            },
                            {
                                name: '牛',
                                type: 'bar',
                                data: array2
                            }
                            ,
                            {
                                name: '羊',
                                type: 'bar',
                                data: array3
                            }
                            ,
                            {
                                name: '家禽',
                                type: 'bar',
                                data: array4
                            }
                        ]
                    };
                    areaChart.setOption(option);


                    //
                }

            }

function t13() {
    var datas=t10();
    var array= new Array();
    var array1= new Array();
    var array2= new Array();
    var array3= new Array();
    var array4= new Array();
    for (var i=0;i<datas.length;i++){
        array.push(datas[i][0].city);
        array1.push(datas[i][0].type);
        array2.push(datas[i][1].type);
        array3.push(datas[i][2].type);
        array4.push(datas[i][3].type);

    }

    var areaChart = echarts.init(document.getElementById('areaChart'));
    option = {

        tooltip: {
            trigger: 'axis',
            axisPointer: {
                type: 'shadow'
            }
        },
        legend: {
            data: ['猪', '牛','羊','家禽'],
            selected: {
                '家禽': false
            }
        },
        toolbox: {
            feature: {
                saveAsImage: {}
            }
        },
        grid: {
            left: '3%',
            right: '4%',
            bottom: '3%',
            containLabel: true
        },
        xAxis: {
            type: 'value',
            boundaryGap: [0, 0.01]
        },
        yAxis: {
            type: 'category',
            data: array
        },
        series: [
            {
                name: '猪',
                type: 'bar',
                data: array1
            },
            {
                name: '牛',
                type: 'bar',
                data: array2
            }
            ,
            {
                name: '羊',
                type: 'bar',
                data: array3
            }
            ,
            {
                name: '家禽',
                type: 'bar',
                data: array4
            }
        ]
    };
    areaChart.setOption(option);

}
            t13();

            //--------------按免疫变化---------------------------
            function factoryoption1() {




                var array1 = new Array();
                $("#city1 option").each(function () {  //遍历所有option
                    var txt = $(this).val();   //获取option值
                    if (txt !="全部") {
                        array1.push(txt);  //添加到数组中
                    }
                });

                return array1;


            }

            function t11() {
                var citys= factoryoption1();

                var list =new Array();
                for(var i=0;i<citys.length;i++){

                    var time1 = $("#start1").val();
                    var time2 = $("#end1").val();
                    if (time1 == "") {
                        time1 = new Date("2000-01-01 :00:00:00");
                    } else {
                        time1 = new Date(time1);
                    }

                    if (time2 == "") {
                        time2 = new Date();
                    } else {
                        time2 = new Date(time2);
                    }
                    var sdata = {   // 构建查询需要的参数
                        city: citys[i],
                        time1: time1,
                        time2: time2
                    };
                    $.ajax({

                        url: '/djt/breedarch/nowtyearim1',
                        data: sdata,
                        dataType :'json',

                        async: false,
                        success: function (data) {
                            list.push(data);
                        }
                    });
                }




                return list;
            }
function t15(){


    var datas=t11();
    var array= new Array();
    var array1= new Array();
    var array2= new Array();
    var array3= new Array();
    var array4= new Array();
    for (var i=0;i<datas.length;i++){
        array.push(datas[i][0].city);
        array1.push(datas[i][0].type);
        array2.push(datas[i][1].type);
        array3.push(datas[i][2].type);
        array4.push(datas[i][3].type);

    }
    var illChart = echarts.init(document.getElementById('illChart'));
    option = {

        tooltip: {
            trigger: 'axis',
            axisPointer: {
                type: 'shadow'
            }
        },
        legend: {
            data: ['猪', '牛','羊','家禽'],
            selected: {
                '家禽': false
            }
        },
        toolbox: {
            feature: {
                saveAsImage: {}
            }
        },
        grid: {
            left: '3%',
            right: '4%',
            bottom: '3%',
            containLabel: true
        },
        xAxis: {
            type: 'value',
            boundaryGap: [0, 0.01]
        },
        yAxis: {
            type: 'category',
            data: array
        },
        series: [
            {
                name: '猪',
                type: 'bar',
                data: array1
            },
            {
                name: '牛',
                type: 'bar',
                data: array2
            }
            ,
            {
                name: '羊',
                type: 'bar',
                data: array3
            }
            ,
            {
                name: '家禽',
                type: 'bar',
                data: array4
            }
        ]
    };
    illChart.setOption(option);


}

           t15();

function t16(){

    var city =$("#city1").val();
    if (city!="全部") {


        var time1 = $("#start1").val();
        var time2 = $("#end1").val();
        if (time1 == "") {
            time1 = new Date("2000-01-01 :00:00:00");
        } else {
            time1 = new Date(time1);
        }

        if (time2 == "") {
            time2 = new Date();
        } else {
            time2 = new Date(time2);
        }
        var sdata = {   // 构建查询需要的参数
            city: city,
            time1: time1,
            time2: time2
        };
        $.ajax({

            url: '/djt/breedarch/nowtyearim1',
            data: sdata,
            dataType: 'json',
            async: false,
            success: function (data) {

                var illChart = echarts.init(document.getElementById('illChart'));
                option = {

                    tooltip: {
                        trigger: 'axis',
                        axisPointer: {
                            type: 'shadow'
                        }
                    },
                    legend: {
                        data: ['猪', '牛', '羊', '家禽'],
                        selected: {
                            '家禽': false
                        }
                    },
                    toolbox: {
                        feature: {
                            saveAsImage: {}
                        }
                    },
                    grid: {
                        left: '3%',
                        right: '4%',
                        bottom: '3%',
                        containLabel: true
                    },
                    xAxis: {
                        type: 'value',
                        boundaryGap: [0, 0.01]
                    },
                    yAxis: {
                        type: 'category',
                        data: [data[0].city]
                    },
                    series: [
                        {
                            name: '猪',
                            type: 'bar',
                            data: [data[0].type]
                        },
                        {
                            name: '牛',
                            type: 'bar',
                            data: [data[1].type]
                        }
                        ,
                        {
                            name: '羊',
                            type: 'bar',
                            data: [data[2].type]
                        }
                        ,
                        {
                            name: '家禽',
                            type: 'bar',
                            data: [data[3].type]
                        }
                    ]
                };
                illChart.setOption(option);


            }
        });

    }else {
        var datas = t11();
        var array = new Array();
        var array1 = new Array();
        var array2 = new Array();
        var array3 = new Array();
        var array4 = new Array();
        for (var i = 0; i < datas.length; i++) {
            array.push(datas[i][0].city);
            array1.push(datas[i][0].type);
            array2.push(datas[i][1].type);
            array3.push(datas[i][2].type);
            array4.push(datas[i][3].type);

        }


    }
}

            function ShowType(cellvalue, options, rowObject) {
                var  type;
                switch (cellvalue){

                    case 101:
                        type="猪瘟";
                        break;
                    case 102:
                        type="口蹄病";
                        break;
                    case 103:
                        type="蓝耳病";
                        break;
                    case 104:
                        type="伪狂犬病";
                        break;
                    case 105:
                        type="细小病毒";
                        break;
                    case 106:
                        type="副伤寒";
                        break;
                    case 107:
                        type="大肠杆菌";
                        break;
                    case 108:
                        type="传染性胃肠";
                        break;
                    case 109:
                        type="乙型脑炎";
                        break;
                    case 110:
                        type="猪丹毒";
                        break;
                    case 111:
                        type="猪肺炎";
                        break;
                    case 112:
                        type="圆环病毒";
                        break;
                    case 113:
                        type="链球菌";
                        break;

                    case 201:
                        type="羊口蹄疫";
                        break;
                    case 202:
                        type="羊布病";
                        break;
                    case 203:
                        type="羊小反刍兽疫";
                        break;
                    case 204:
                        type="羊三联四防疫苗";
                        break;
                    case 205:
                        type="羊痘";
                        break;
                    case 206:
                        type="羊传染性胸膜肺炎";
                        break;
                    case 207:
                        type="羊链球菌疫苗";
                        break;

                    case 301:
                        type="牛口蹄疫";
                        break;
                    case 302:
                        type="牛布病";
                        break;
                    case 401:
                        type="禽流感";
                        break;
                    case 402:
                        type="新城疫";
                        break;
                    case 403:
                        type="新支二联苗";
                        break;
                    case 404:
                        type="法氏囊";
                        break;
                    case 405:
                        type="鸡痘";
                        break;
                    case 406:
                        type="鸡减蛋综合症";
                        break;


                    case 999:
                        type="其它";
                        break;

                }
                return type;
            }


            //猪疫苗
            var PIGVACCINE = {
                101: '猪瘟',
                102: '口蹄疫',
                103: '蓝耳病',
                104: '伪狂犬病',
                105: '细小病毒',
                106: '副伤寒',
                107: '大肠杆菌',
                108: '传染性胃肠',
                109: '乙型脑炎',
                110: '猪丹毒',
                111: '猪肺炎',
                112: '圆环病毒',
                113: '链球菌'

            }
            // 羊疫苗
            var SHEEPVACCINE = {
                201: '羊口蹄疫',
                202: '羊布病',
                203: '羊小反刍兽疫',
                204: '羊三联四防疫苗',
                205: '羊痘',
                206: '羊传染性胸膜肺炎',
                207: '羊链球菌疫苗'

            }
            // 牛疫苗
            var CATTLEVACCINE = {
                301: '牛口蹄疫',
                302: '牛布病'

            }
            // 家禽疫苗
            var POULTRYVACCINE = {
                401: '禽流感',
                402: '新城疫',
                403: '新支二联苗',
                404: '法氏囊',
                405: '鸡痘',
                406: '鸡减蛋综合症',
                999: '其它'
            }

  function imtypes() {

            $(".imtype").each(function () {

               var a= ShowType(parseInt($(this).text()),null,null);
                $(this).text(a);

            })
    }

            imtypes();

            function imtion(){

                for(var key in PIGVACCINE){
                    var str ="<option value="+key+">"+PIGVACCINE[key]+"</option>";
                    $(".immunityType").append(str);
                }
                for(var key1 in SHEEPVACCINE){
                    var str ="<option value="+key1+">"+SHEEPVACCINE[key1]+"</option>";
                    $(".immunityType").append(str);
                }
                for(var key2 in CATTLEVACCINE){
                    var str ="<option value="+key2+">"+CATTLEVACCINE[key2]+"</option>";
                    $(".immunityType").append(str);
                }
                for(var key3 in POULTRYVACCINE){
                    var str ="<option value="+key3+">"+POULTRYVACCINE[key3]+"</option>";
                    $(".immunityType").append(str);
                }
            }
            imtion();

        </script>

</body>
</html>
